package concreteClass;

import abstractClass.ReportGenerator;

import java.io.File;
import java.util.List;

/**
 * HTML报告生成器 - 具体子类
 */
public class HtmlReportGenerator extends ReportGenerator {
    
    @Override
    protected String generateContent(List<Object> data) {
        StringBuilder content = new StringBuilder();
        content.append("<html><body><h1>HTML报告内容</h1><ul>");
        for (Object item : data) {
            content.append("<li>").append(item.toString()).append("</li>");
        }
        content.append("</ul></body></html>");
        return content.toString();
    }
    
    @Override
    protected String formatReport(String report) {
        System.out.println("将报告格式化为HTML格式...");
        // 实际的HTML格式化逻辑
        return report;
    }
    
    @Override
    protected File saveReport(String report) {
        System.out.println("保存HTML报告到文件...");
        // 实际的保存逻辑
        return new File("report.html");
    }
}